// 加工厂管理api
import http from '../../utils/request/request'

// 获取所有加工厂
export function getProcessListReq() {
    return http({
        url: `/processing/processing-factory/`,
        method: 'get'
    })
}

// 分页获取加工厂
export function getPlantInfoByPage(page = 1, size = 5) {
    return http({
        url: `/processing/processing-factory/current-enterprise-factory/page/${page}/${size}`,
        method: 'get'
    })
}

// 根据加工厂id查询加工厂
export function getPlantInfoById(id) {
    return http({
        url: `/processing/processing-factory/${id}`
    })
}

// 模糊查询加工厂信息
export function getPlantInfoByNameOrAddress(value, page = 1, size = 5) {
    return http({
        url: `/processing/processing-factory/query/${value}/page/${page}/${size}`,
    })
}

// 添加加工厂
export function addPlant(data) {
    return http({
        url: '/processing/processing-factory/',
        method: 'POST',
        data
    })
}

// 修改加工厂信息
export function editPlant(data) {
    return http({
        url: '/processing/processing-factory/',
        method: 'PUT',
        data
    })
}

// 删除加工厂信息
export function deletePlantById(id) {
    return http({
        url: `/processing/processing-factory/${id}`,
        method: 'DELETE'
    })
}